package com.team.cloudsharing.dao.remember;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.team.cloudsharing.dao.user.UserDO;

@Entity
@Table(name = "remember")
public class RememberDO implements Serializable{

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "remember_id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long rememberId;
	
	@Column(name = "remember_token", nullable = false)
	private String rememberToken;

	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	private UserDO userDO;
	
	public RememberDO() {
	}

	public RememberDO(String rememberToken, UserDO userDO) {
		super();
		this.rememberToken = rememberToken;
		this.userDO = userDO;
	}

	public Long getRememberId() {
		return rememberId;
	}

	public void setRememberId(Long rememberId) {
		this.rememberId = rememberId;
	}

	public String getRememberToken() {
		return rememberToken;
	}

	public void setRememberToken(String rememberToken) {
		this.rememberToken = rememberToken;
	}

	public UserDO getUserDO() {
		return userDO;
	}

	public void setUserDO(UserDO userDO) {
		this.userDO = userDO;
	}
	
}
